package com.scetop.bank;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class Bank {
    public static Bank bank = new Bank();
    private final List<Customer> customers;
    public Bank(){customers = new ArrayList<>();
    }

    public static Bank getBank(){
        return bank;
    }

    public  void addCustomer(String f, String l){
//        Customer customer = new Customer(f,l);
//        customers[numberOfCustomers] = customer;
//        numberOfCustomers++;
        customers.add(new Customer(f,l));
    }

    public int getNumOfCustomers(){
//        return numberOfCustomers;
        return customers.size();
    }
    public  Customer getCustomer(int index) {
//        return customers[index];
        return customers.get(index);
    }

    public Iterator<Customer> getCustomers(){
        return customers.iterator();
    }
}